package com.shenyong.controller;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * @author
 * @site
 * @company
 * @create
 */
public class test {
     public static  void main(String arg[]) {
         //盐值用的用的是对用户名的加密（测试用的"lisi"）
         ByteSource credentialsSalt01 = ByteSource.Util.bytes("林志玲");
         Object credential = "linzhiling";//密码
         String hashAlgorithmName = "MD5";//加密方式
         //1024指的是加密的次数8c702ae443795331c91cfab48f3f3833
         Object simpleHash = new SimpleHash(hashAlgorithmName, credential,
                 credentialsSalt01, 1024);
         System.out.println("加密后的值----->" + simpleHash);
      }
}
